﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        .big
        {
            width: 400px;
            height: 600px;
            background-color: #444;
        }
        
        
        .big_div
        {
            width: 300px;
            height: 500px;
            background-color: #555;
        }
        
        .small
        {
            width: 200px;
            height: 400px;
            background-color: #444;
        }
        
        
        .small_div
        {
            width: 100px;
            height: 300px;
            background-color: #555;
        }
        .small_backcolor_red
        {
            background-color: Red;
        }
    </style>
    <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
    <script type="text/javascript">
        function switchClass() {
            $(".big").switchClass("big", "small", 1000, "easeInOutQuad")
            .find("div").switchClass("big_div", "small_div", 1000, "easeInOutQuad");

            $(".small").switchClass("small", "big", 1000, "easeInOutQuad")
            .find("div").switchClass("small_div", "big_div", 1000, "easeInOutQuad");
        }

        function toggleClass() {
            $("#divAnimate").toggleClass("small_backcolor_red", 1000, "easeInOutQuad");
        }
    </script>
</head>
<body>
    <div class="big" id="divAnimate">
        <div class="big_div">
        </div>
    </div>
    <button onclick="switchClass()">
        switch Class</button>
    <button onclick="toggleClass()">
        switch Class</button>
</body>
</html>
